Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send mattermost action #14

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Send mattermost action #14

wants to merge 8 commits into from

Conversation

kshann
Copy link

@kshann kshann commented Nov 13, 2024

Task/Issue URL: https://app.asana.com/0/1205419239275955/1208297538472343/f

Description:

  • Send message to mattermost action
  • Unit tests

Template tests to mattermost
image

Copy link
Contributor

@ayoy ayoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but it would be ideal if we adopted ERB templates for MM message templates (just like all other templates already).

@kshann
Copy link
Author

kshann commented Nov 14, 2024

@ayoy updated to erb templates 👍

Copy link
Contributor

@ayoy ayoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I added specs for verifying messages content - to be sure that messages are formatted correctly (we use the same for other ERB templates).

it "handles unsuccessful HTTP response" do
allow(HTTParty).to receive(:post).and_return(double(success?: false, body: "Error message"))

expect { Fastlane::Actions::MattermostSendMessageAction.run(params) }.to raise_error(FastlaneCore::Interface::FastlaneError, "Failed to send message: Error message")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets a bit verbose so we usually provide a helper function in the spec called e.g. run, calling Fastlane::Actions::MattermostSendMessageAction.run inside. See process_template at the bottom of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants